<?php

class SimilarWidget extends CWidget {

	public $model;
    public function init() {
			$this->renderContent();
    }
    protected function renderContent() {
    	$criteria=new CDbCriteria;
        $criteria->limit = 10;
    	$criteria->condition = "subjobtype_id = ".$this->model->subjobtype_id;
    	$criteria->join = "INNER JOIN tbl_job_skill b ON t.id = b.id";
    	foreach ($this->model->jobSkills as $key) {
    		$skill_id = $key->skill_id;
    		$criteria->addCondition("b.skill_id = $skill_id");
            // echo $key->id;
    	}
        // echo $this->model->jobSkills->id.'akjakslksda';
    	$data = Job::model()->findAll($criteria);
    	$this->render('similar',array('data'=>$data));
    }

}

?>
